<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>





<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>动海科技</title>
<!-- Bootstrap -->
<link href="./bootstrap-3.3.5-dist/css/bootstrap.min.css"
	rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<style>
.ln-guild {
	clear: both;
	position: fixed;
	right: 0px;
	top: 130px;
	z-index: 0;
}

.rn-guild {
	clear: both;
	position: fixed;
	left: 0px;
	top: 130px;
	z-index: 0;
}
</style>
<script>"undefined" == typeof CODE_LIVE && (!function(e) {
		var t = {
				nonSecure : "52004",
				secure : "52009"
			},
			c = {
				nonSecure : "http://",
				secure : "https://"
			},
			r = {
				nonSecure : "127.0.0.1",
				secure : "gapdebug.local.genuitec.com"
			},
			n = "https:" === window.location.protocol ? "secure" : "nonSecure";
		script = e.createElement("script"), script.type = "text/javascript", script.async = !0, script.src = c[n] + r[n] + ":" + t[n] + "/codelive-assets/bundle.js", e.getElementsByTagName("head")[0].appendChild(script)
	}(document), CODE_LIVE = !0);
</script>
</head>
<body data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-3"
	data-genuitec-path="/mrks/WebContent/WEB-INF/view/kaoshi.jsp">

	<div class="container-fluid" style="background-color: #293448;" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc8-4" data-genuitec-path="/mrks/WebContent/startAnswer.jsp">
	<div class="container">
		<table>
			<tr>
				<td style="width: 160px;padding-left: 80px;">
					<img alt="" src="imgs2/logo.png">
				</td>
				<td style="width: 110px;">
					<div class="text-center" style="padding-bottom: 10px;padding-top: 30px;">
						<a href="main.jsp" style="color: #73ca33;">首页</a>
					</div>
					<div style="background-color: green;height: 3px;">
						
					</div>
				</td>
				<td style="width: 110px;">
					<div class="text-center" style="padding-bottom: 10px;padding-top: 30px;">
					<a href="startTest.zxks" style="color: #ffffff;">在线考试</a>
					</div>
					<div style="height: 3px;">
						
					</div>
				</td>
				<td style="width: 110px;">
					<div class="text-center" style="padding-bottom: 10px;padding-top: 30px;">
						<a href="findinfo.zxks" style="color: #ffffff;">成绩查询</a>
					</div>
					<div style="height: 3px;">
						
					</div>
				</td>
				<td >
					<div class="text-center" style="padding-bottom: 10px;padding-top: 30px;">
						<a href="#" style="color: #ffffff;">你好,尊敬的会员:${sessionScope.user.uname}</a>
					</div>
				</td>
				<td >
					<div class="text-center" style="padding-bottom: 10px;padding-top: 30px;margin-left: 40px">
						<a href="main.jsp" style="color: rgb(115,202,51);">退出</a>
					</div>
					<div style="height: 3px;">
						
					</div>
				</td>
			</tr>
		</table>
	</div>
</div>
	

	<div class="container bg-warning" style="padding-top: 65px;">
		<!-- 测试交卷到登陆界面便于后期更改 -->
		<form id="actionSub" action="startResult.zxks" method="post">
			<h3 class="text-primary text-center">
				<span class="glyphicon glyphicon-tags"></span><span
					style="padding-left: 9px;">数学试题(卷一)</span>
			</h3>
			<div class="well text-primary">
				<span class="glyphicon glyphicon-book">试卷说明:</span> <br />
				<ol>
					<li>本卷共${timu.size() }小题,作答时间为${main.main_ansTime }分钟,总分${zongfen}分.</li>
					<li>试题年份:${main.main_mkTime.substring(0,4)}</li>
					<li>试卷来源:考试资料网在线考试中心.</li>
					<li>鼠标左键双击标题可在答题卡制作标记.</li>
					<li>点击交卷时，统计分数.</li>
					<li>点击退出考试，不统计分数.</li>
				</ol>
			</div>
			<table class="table table-hover" style="color: 000000;">
<!-- 隐藏域 用于后台获取这道题是单选还是双选 -->
					<input type="hidden" name="mainid" value="${mainid }">

				<tbody>
					<c:forEach items="${timu }" var="t" varStatus="st">
<%-- 					<!-- 隐藏域 用于后台获取这道题是单选还是双选 -->
					<input type="hidden" name="leixing-${t.key.que_id}" value="${t.key.que_type }"> --%>
						<tr class="success" ondblclick="setFlag(${st.index})">
							<th><a name="a${st.index}" id="a${st.index}"
								style="padding-top: 61px;"></a>
								<h4 style="color: #000000;">
									<span class="glyphicon glyphicon-paperclip text-danger"></span>${st.count }-${t.key.que_title }
									[<a href="javascript:void(0)" onclick="setFlag(${st.index}))">答题标记</a>]
								</h4></th>
						</tr>
						<tr>


							<td style="padding-left: 40px">
								<ol class="text-primary" style="font-size: 14px;">
									<!-- 	题目对应的答案 -->
									<c:forEach var="l" items="${t.value }">

										<li>
											<div class="${t.key.que_type }">
											<!-- 答案的value数值就是答案对应的id  --> 
											<!-- 答案的name数值就是答案对应的题目id  --> 
												<label><input type="${t.key.que_type }"
												value="${l.ans_id}" name="${l.que_id}" aria-label="...">${l.ans_content }</label>
											</div>
										</li>
									</c:forEach>
								</ol> <br />
							</td>
						</tr>
					</c:forEach>

				</tbody>



			</table>
			<input type="hidden" name="main_id" value="1">
		</form>
	</div>

	<div class="rn-guild">
		<div class="panel panel-success">
			<div class="panel-heading">考试剩余时间</div>
			<div class="panel-body">
				<a href="#">倒计时 <span id="t_h"></span>时<span id="t_m"></span>分<span
					id="t_s"></span>秒
				</a>
			</div>
		</div>
	</div>

	<div id="card_body" class="ln-guild">
		<div class="panel panel-success">
			<div class="panel-heading">
				<h5>答题卡</h5>
				<!-- <a href="#">倒计时 <span id="t_h"></span>时<span id="t_m"></span>分<span id="t_s"></span>秒</a> -->
			</div>
			<div class="panel-body">


				<table class="table table-bordered">
					<!-- 答题卡标记 -->
					<tr>
						<c:forEach var="t" begin="0" end="${timu.size()-1 }">

							<td><a id="dtk${t }" class="btn btn-info btn-xs"
								href="javascript:void(0);" onclick="goIndex(${t })"> ${t+1 }
							</a></td>
							<c:if test="${(t+1)%6==0 }">
					</tr>
					</c:if>
					<c:if test="${(t+1)%6==0 }">
						<tr>
					</c:if>
					</c:forEach>

					</tr>

					<!-- <td><a id="dtk1" class="btn btn-info btn-xs"
							href="javascript:void(0);" onclick="goIndex(1)"> 02 </a></td> -->


				</table>


			</div>
			<div class="panel-footer">
				<p class="text-center">
					<button type="button" class="btn btn-success btn-sm"
						onclick="submitGo();">
						<span class="glyphicon glyphicon-pencil"></span>交卷
					</button>
				</p>
				<p class="text-center">
					<button type="button" class="btn btn-success btn-sm"
						onclick="submitback();">
						<span class="glyphicon glyphicon-pencil"></span>退出考试
					</button>
				</p>
			</div>
		</div>
	</div>
	<div class="container-fluid" style="background-color: #293448;">
	<div class="container-fluid text-center" style="height: 80px;line-height: 80px;" >
		<span style="color: #ffffff;">合肥动海科技有限公司 Copyright@www.donghaisoft.com</span>
	</div>
</div>

	<script src="./bootstrap-3.3.5-dist/js/jquery-1.11.3.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script type="text/javascript"
		src="./bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript">
		var basePath = '';
		var socketPath = 'localhost:8080/mrks/';
	</script>
	<script type="text/javascript" src="js/websocket.js?V=0.2"></script>
	<script type="text/javascript">
		function setFlag(flag) {
			if ($("#dtk" + flag).hasClass('btn-info')) {
				$("#dtk" + flag).removeClass('btn-info').addClass('btn-warning');
			} else {
				$("#dtk" + flag).removeClass('btn-warning').addClass('btn-info');
			}
		}
	
		function goIndex(flag) {
			window.location.hash = "a" + flag;
			window.location.href = "#a" + flag;
		}
	
		function submitGo() {
			websocket.close();
			$("#actionSub").submit();
		}
		function submitback() {
			if(confirm("退出考试,不计分")) {
			window.location.href="selectPapers.jsp";
			}
		}
	
		function hideFooter() {
			$("#footer").hide();
		}
	</script>
</body>
</html>